import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
    state: () => ({
        menuVisible: true,
        file: null
    }),
    getters: {
        userFullName: state => `${state.name} (${state.email})`
    },
    actions: {
        changeMenuVisible() {
            this.menuVisible = !this.menuVisible
            console.log('====================================')
            console.log('kaka')
            console.log('====================================')
        },
        setFile(file) {
            this.file = file
        }
    },
    persist: true // 这将启用状态持久化
})
